<div class='line'>
  <div id='my_zhuis'> 
    <div class="types">
      <%= link_to_function "全部 <small>#{@types.current_user_zhuis_count}</small>/<b>#{@types.hot_posts_count}</b>",
            "$('type_id').value = '';my_zhuis()",
            :title => "共#{@types.hot_posts_count}贴，我追了其中的#{@types.current_user_zhuis_count}贴",
            :class => "type #{params[:hot_post_type_id] == '%' ? 'h' : ''}"
       %>
      <% @types.each do |type| %>
      ┊
      <%= link_to_function "『#{type.name}』<small>#{type.current_user_zhuis_count}</small>/<b>#{type.hot_posts_count}</b>",
            "$('type_id').value = '#{type.id}';my_zhuis()",
            :title => "共#{type.hot_posts_count}贴，我追了其中的#{type.current_user_zhuis_count}贴",
            :class => "type #{type.id.to_s == params[:hot_post_type_id] ? 'h' : ''}"
      %>
      <% end %>
      <%= link_to '天涯社区有个帖很有意思,怎么没人追?我来!', new_tools_zhui_tian_ya_hot_post_url , :class => :new, :target => :_blank %>
    </div>
    <div class='hot_posts'>
      <% @hot_posts.each do |hot_post|  %>
      <div id="my_zhui_hot_post_<%= hot_post.id %>" class='hot_post <%= cycle '','h' %>'>
        <div class='head'>
          <div class='type'>
            『<%= hot_post.hot_post_type.name %>』
          </div>
          <div class='title'>
            <%= link_to (truncate hot_post.title, :length => 30) , tools_zhui_tian_ya_hot_post_url(hot_post), :target => :_blank, :title => "#{hot_post.title}-#{t hot_post.status}", :class => hot_post.status %>
          </div>           
          <% if hot_post.current_user_follow_setting %>           
          <div class='read_schedule' title='我已经阅读了<%= number_with_precision hot_post.current_user_follow_setting.read_schedule_percent, :precision => 2 %>%'>
            <div class='tip'>
              阅读进度：  
            </div>
            <div class='unread'>
              <div class='read' style='width:<%= hot_post.current_user_follow_setting.read_schedule_ratio * 30 %>px;' ></div>
            </div>
          </div>
          <% end %>
        </div>
        <div class="body">
          <div class='about_author'>
            <dl>
              <dt>作者：</dt>
              <dd><%= hot_post.author %></dd>
            </dl>
            <dl class='l'>
              <dd>首次发表于<%= time_ago_in_words hot_post.first_released_at, false %>前</dd>
            </dl>
            <dl class='l'>
              <dd>共发表<b><%= hot_post.lz_sub_hot_posts_count %></b>帖</dd>
            </dl>
            <% if hot_post.the_last_lz_sub_hot_post %>
            <dl class='l'>
              <dd>最后一次发表于<%= time_ago_in_words hot_post.the_last_lz_sub_hot_post.released_at,false %>前</dd>
            </dl>
            <% end %>
          </div>
          <div class='about_mine'>        
            <dl >
              <dt>我的追贴状况：</dt>                          
            </dl>        
            <% if hot_post.current_user_follow_setting %>
            <dl class='l'>
              <dd>首次阅读于<%= time_ago_in_words hot_post.current_user_follow_setting.created_at, false %>前</dd>
            </dl>
            <dl class='l'>
              <dd>已经阅读了<b class='read'><%= number_with_precision hot_post.current_user_follow_setting.read_schedule_percent, :precision => 2 %>%</b></dd>
            </dl>
            <dl class='l'>
              <dd>最后一次阅读于<%= time_ago_in_words hot_post.current_user_follow_setting.updated_at, false %>前</dd>
            </dl>
            <% else %>
            <dl class='l'>
              <dd>未追！</dd>
            </dl>
            <% end %>
          </div>
          <div class='about_others'>                        
            <dl>
              <dt>其他会员追贴状况：</dt>                          
            </dl>
            <dl class='l'>
              <dd>该贴由<%= link_to hot_post.user.call_name , user_url(hot_post.user) %>于<%= time_ago_in_words hot_post.created_at,false %>前发起追踪活动</dd>
            </dl>
            <% if hot_post.the_fastest_setting %>
            <dl class='l'>
              <dd>
                截止目前为止共<b><%= hot_post.users_count %></b>人追该贴,
                <% if hot_post.the_fastest_setting.user.current? %>
                  其中<%= link_to '我', users_url(hot_post.the_fastest_setting.user), :target => :_blank %>冲在队伍的最前面,已阅读了该贴的<b class='read'><%= number_with_precision hot_post.the_fastest_setting.read_schedule_percent, :precision => 2 %>%</b>，暂列第<b class='first'>1</b>位
                <% else %>
                  其中<%= link_to hot_post.the_fastest_setting.user.nick_name, users_url(hot_post.the_fastest_setting.user), :target => :_blank %>冲在队伍的最前面,已阅读了该贴的<b class='read'><%= number_with_precision hot_post.the_fastest_setting.read_schedule_percent, :precision => 2 %>%</b>，暂列第<b class='first'>1</b>位，我目前排在<b class='m_p'><%= hot_post.current_user_read_position %></b>位
                <% end %>
              </dd>
            </dl>
            <% end %>
          </div>
        </div>
        <div class='foot'>
          <div class='tools'>
          <div id="my_zhui_hot_post_<%= hot_post.id %>_tools" class='tools'>
          <% if hot_post.current_user_follow_setting %>
            <% if hot_post.current_user_follow_setting.all_read? %>
              <%= link_to '看看其他人的回复，很有意思', tools_zhui_tian_ya_hot_post_url(hot_post, :scope => 'all') , :class => :read, :target => :_blank if hot_post.current_user_follow_setting.scope.lz?%>
            <% else %>
              <%= link_to '继续阅读', tools_zhui_tian_ya_hot_post_url(hot_post) , :class => :read, :target => :_blank %>
            <% end %>
            <%= link_to_remote "#{hot_post.current_user_follow_setting.all_read? ? '已看完，' : ''}不追了",
                  :url => give_up_tools_zhui_tian_ya_hot_post_url(hot_post) ,
                  :loading => small_loading("my_zhui_hot_post_#{hot_post.id}_tools",:only_image => true),
                  :complete => 'my_zhuis_without_loading()',
                  :method => :put,
                  :html => {
                    :class => :give_up,
                    :target => :_blank
                  } %>

          <% else %>
            <%= link_to '开始阅读', tools_zhui_tian_ya_hot_post_url(hot_post) , :class => :s_read, :target => :_blank %>
          <% end %>
          </div>
          </div>
        </div>
      </div>
      <% end %>
      <% if @hot_posts.empty? %>
      <div id='no_record'>
        一条也没有！<%= link_to '我来追个吧。。。', new_tools_zhui_tian_ya_hot_post_url , :target => :_blank %>
        或者 <%= link_to "看看大伙都在追什么", tools_zhui_tian_ya_hot_posts_url, :target => :_blank, :title => "共有篇#{@types.hot_posts_count}帖子可追" %>
      </div>
      <% end %>
    </div>
    <% if @hot_posts.any? %>
    <div class='read_more'>
      <%= link_to "想看更多(<b>#{@types.hot_posts_count}</b>)...", tools_zhui_tian_ya_hot_posts_url, :target => :_blank, :title => "共有篇#{@types.hot_posts_count}帖子可追" %>      
    </div>    
    <% end %>
  </div>
</div>